.class public Lcom/netease/newsreader/util/CollectArticleAdapter;
.super Landroid/widget/BaseAdapter;
.source "CollectArticleAdapter.java"


# instance fields
.field private allCheckStatus:Z

.field private app:Lcom/netease/newsreader/activity/MyApplication;

.field private db:Landroid/database/sqlite/SQLiteDatabase;

.field private mContext:Landroid/content/Context;

.field private mGlobal:Landroid/widget/CheckBox;

.field private mInflater:Landroid/view/LayoutInflater;

.field private mIsSee:Z

.field private mList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private mSelectNum:I

.field private mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;Z)V
    .locals 1
    .parameter "context"
    .parameter
    .parameter "isSee"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;Z)V"
        }
    .end annotation

    .prologue
    .line 64
    .local p2, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 66
    iput-object p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mContext:Landroid/content/Context;

    .line 67
    iput-object p2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mList:Ljava/util/List;

    .line 68
    iput-boolean p3, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mIsSee:Z

    .line 69
    invoke-static {p1}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 70
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 71
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/util/List;ZLandroid/widget/CheckBox;)V
    .locals 1
    .parameter "context"
    .parameter
    .parameter "isSee"
    .parameter "global"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;Z",
            "Landroid/widget/CheckBox;",
            ")V"
        }
    .end annotation

    .prologue
    .line 45
    .local p2, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 47
    iput-object p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mContext:Landroid/content/Context;

    .line 48
    iput-object p2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mList:Ljava/util/List;

    .line 49
    iput-boolean p3, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mIsSee:Z

    .line 50
    iput-object p4, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mGlobal:Landroid/widget/CheckBox;

    .line 51
    iget-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/activity/MyApplication;

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->app:Lcom/netease/newsreader/activity/MyApplication;

    .line 52
    iget-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->app:Lcom/netease/newsreader/activity/MyApplication;

    invoke-virtual {v0}, Lcom/netease/newsreader/activity/MyApplication;->getSQLiteDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 53
    invoke-static {p1}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 54
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 55
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/util/CollectArticleAdapter;)I
    .locals 1
    .parameter

    .prologue
    .line 35
    iget v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mSelectNum:I

    return v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/util/CollectArticleAdapter;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 35
    iput p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mSelectNum:I

    return-void
.end method

.method static synthetic access$2(Lcom/netease/newsreader/util/CollectArticleAdapter;)Landroid/database/sqlite/SQLiteDatabase;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->db:Landroid/database/sqlite/SQLiteDatabase;

    return-object v0
.end method

.method static synthetic access$3(Lcom/netease/newsreader/util/CollectArticleAdapter;)Landroid/widget/CheckBox;
    .locals 1
    .parameter

    .prologue
    .line 28
    iget-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mGlobal:Landroid/widget/CheckBox;

    return-object v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/util/CollectArticleAdapter;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 36
    iput-boolean p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->allCheckStatus:Z

    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 76
    iget-object v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 82
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 88
    int-to-long v0, p1

    return-wide v0
.end method

.method public getSelectNums()I
    .locals 1

    .prologue
    .line 191
    iget v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mSelectNum:I

    return v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 14
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 93
    new-instance v4, Ljava/util/HashMap;

    invoke-direct {v4}, Ljava/util/HashMap;-><init>()V

    .line 94
    .local v4, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    iget-object v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mList:Ljava/util/List;

    invoke-interface {v11}, Ljava/util/List;->size()I

    move-result v11

    if-lez v11, :cond_0

    .line 95
    iget-object v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mList:Ljava/util/List;

    invoke-interface {v11, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    .end local v4           #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v4, Ljava/util/Map;

    .line 96
    .restart local v4       #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    :cond_0
    const-string v11, "auto_id"

    invoke-interface {v4, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    .line 98
    .local v2, deleteID:Ljava/lang/String;
    const/4 v10, 0x0

    .line 100
    .local v10, view:Landroid/widget/RelativeLayout;
    if-nez p2, :cond_4

    .line 101
    iget-object v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v12, 0x7f03000d

    const/4 v13, 0x0

    invoke-virtual {v11, v12, v13}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v10

    .end local v10           #view:Landroid/widget/RelativeLayout;
    check-cast v10, Landroid/widget/RelativeLayout;

    .line 102
    .restart local v10       #view:Landroid/widget/RelativeLayout;
    iget-boolean v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mIsSee:Z

    if-nez v11, :cond_1

    .line 103
    const v11, 0x7f0c004d

    invoke-virtual {v10, v11}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/TextView;

    .line 104
    .local v7, text:Landroid/widget/TextView;
    invoke-virtual {v7}, Landroid/widget/TextView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v3

    check-cast v3, Landroid/widget/RelativeLayout$LayoutParams;

    .line 105
    .local v3, lp:Landroid/widget/RelativeLayout$LayoutParams;
    const/4 v11, 0x0

    const v12, 0x7f0c004c

    invoke-virtual {v3, v11, v12}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V

    .line 106
    const v11, 0x7f0c004c

    invoke-virtual {v10, v11}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/CheckBox;

    .line 107
    .local v1, cb:Landroid/widget/CheckBox;
    const/4 v11, 0x0

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setVisibility(I)V

    .line 113
    .end local v1           #cb:Landroid/widget/CheckBox;
    .end local v3           #lp:Landroid/widget/RelativeLayout$LayoutParams;
    .end local v7           #text:Landroid/widget/TextView;
    :cond_1
    :goto_0
    const v11, 0x7f0c004d

    invoke-virtual {v10, v11}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/TextView;

    .line 114
    .restart local v7       #text:Landroid/widget/TextView;
    const v11, 0x7f0c004c

    invoke-virtual {v10, v11}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/CheckBox;

    .line 115
    .restart local v1       #cb:Landroid/widget/CheckBox;
    invoke-virtual {v7, v2}, Landroid/widget/TextView;->setTag(Ljava/lang/Object;)V

    .line 116
    invoke-virtual {v1, v2}, Landroid/widget/CheckBox;->setTag(Ljava/lang/Object;)V

    .line 118
    const/4 v11, 0x0

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 120
    iget-boolean v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mIsSee:Z

    if-nez v11, :cond_3

    .line 124
    iget-boolean v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->allCheckStatus:Z

    if-eqz v11, :cond_5

    const/4 v11, 0x1

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 142
    :cond_2
    :goto_1
    new-instance v11, Lcom/netease/newsreader/util/CollectArticleAdapter$1;

    invoke-direct {v11, p0, v2}, Lcom/netease/newsreader/util/CollectArticleAdapter$1;-><init>(Lcom/netease/newsreader/util/CollectArticleAdapter;Ljava/lang/String;)V

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 172
    :cond_3
    const-string v11, "collect_title"

    invoke-interface {v4, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v8

    .line 173
    .local v8, title:Ljava/lang/Object;
    if-nez v8, :cond_7

    const-string v6, ""

    .line 174
    .local v6, str:Ljava/lang/String;
    :goto_2
    invoke-virtual {v7, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 175
    new-instance v11, Ljava/lang/StringBuilder;

    invoke-direct {v11}, Ljava/lang/StringBuilder;-><init>()V

    const-string v12, "collect_type"

    invoke-interface {v4, v12}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v12

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    .line 176
    .local v9, type:Ljava/lang/String;
    invoke-virtual {v7, v9}, Landroid/widget/TextView;->setTag(Ljava/lang/Object;)V

    .line 177
    iget-object v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v12, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mContext:Landroid/content/Context;

    const v13, 0x7f080027

    invoke-virtual {v11, v12, v7, v13}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 178
    return-object v10

    .end local v1           #cb:Landroid/widget/CheckBox;
    .end local v6           #str:Ljava/lang/String;
    .end local v7           #text:Landroid/widget/TextView;
    .end local v8           #title:Ljava/lang/Object;
    .end local v9           #type:Ljava/lang/String;
    :cond_4
    move-object/from16 v10, p2

    .line 110
    check-cast v10, Landroid/widget/RelativeLayout;

    goto :goto_0

    .line 128
    .restart local v1       #cb:Landroid/widget/CheckBox;
    .restart local v7       #text:Landroid/widget/TextView;
    :cond_5
    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "select * from collect_table where auto_id=\'"

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 129
    invoke-virtual {v11, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "\'"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    .line 128
    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 130
    .local v5, s:Ljava/lang/String;
    iget-object v11, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v12, 0x0

    new-array v12, v12, [Ljava/lang/String;

    invoke-virtual {v11, v5, v12}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 131
    .local v0, c:Landroid/database/Cursor;
    if-eqz v0, :cond_6

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v11

    if-lez v11, :cond_6

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v11

    if-eqz v11, :cond_6

    .line 132
    const-string v11, "ischecked"

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v11

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v11

    if-eqz v11, :cond_6

    .line 133
    const-string v11, "ischecked"

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v11

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v11

    const-string v12, "1"

    invoke-virtual {v11, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_6

    .line 134
    const/4 v11, 0x1

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 138
    :goto_3
    if-eqz v0, :cond_2

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    goto/16 :goto_1

    .line 136
    :cond_6
    const/4 v11, 0x0

    invoke-virtual {v1, v11}, Landroid/widget/CheckBox;->setChecked(Z)V

    goto :goto_3

    .line 173
    .end local v0           #c:Landroid/database/Cursor;
    .end local v5           #s:Ljava/lang/String;
    .restart local v8       #title:Ljava/lang/Object;
    :cond_7
    invoke-virtual {v8}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v6

    goto/16 :goto_2
.end method

.method public setCheckOrNoAllBox(Z)V
    .locals 1
    .parameter "isChecked"

    .prologue
    .line 182
    iput-boolean p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->allCheckStatus:Z

    .line 183
    if-eqz p1, :cond_0

    .line 184
    invoke-virtual {p0}, Lcom/netease/newsreader/util/CollectArticleAdapter;->getCount()I

    move-result v0

    iput v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mSelectNum:I

    .line 188
    :goto_0
    return-void

    .line 186
    :cond_0
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/util/CollectArticleAdapter;->mSelectNum:I

    goto :goto_0
.end method
